#include <stdio.h>
int main()
{
    int n,a[100],i,j,temp;
    int k(int);
    while (scanf("%d",&n)!=EOF)
    {
        if (n==0)break;
        for (i=0;i<n;i++)scanf("%d",&a[i]);
        for (i=0;i<n;i++)
            for (j=i+1;j<n;j++)
                if (k(a[j])>k(a[i]))
                {
                    temp=a[i];
                    a[i]=a[j];
                    a[j]=temp;
                }
        for (i=0;i<n-1;i++)printf("%d ",a[i]);
        printf("%d\n",a[n-1]);
    }
    return 0;
}
int k(int a)
{
    if (a<0)return -a;
    return a;
}